package com.huifaapp.mall.adapter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import java.util.List;

/**
 * 
* @ClassName: IntroductionPageAdapter 
* @Description: TODO(引导页) 
* @author lijs
* @date 2016年5月11日 下午1:34:37 
*
 */
public class IntroductionPageAdapter extends PagerAdapter {
	@SuppressWarnings("unused")
	private Context context;
	private List<ImageView> imagelist;
	public IntroductionPageAdapter(Context context, List<ImageView> imagelist) {
		this.context=context;
		this.imagelist=imagelist;
	}
	@Override
	public int getCount() {
		return imagelist.size();
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		return arg0==arg1;
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		// TODO Auto-generated method stub
		container.removeView(imagelist.get(position));
	}

	@Override
	public Object instantiateItem(ViewGroup container, final int position) {
		container.addView(imagelist.get(position));
		return imagelist.get(position);
	}
}
